package com.frank.oj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.frank.model.entity.judge.Judge;
import com.frank.oj.model.vo.ContestScrollBoardSubmissionVO;
import com.frank.oj.model.vo.JudgeVO;
import com.frank.oj.model.vo.ProblemCountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author frank
 * @Date 2024/1/25
 */
@Mapper
@Repository
public interface JudgeMapper extends BaseMapper<Judge> {
    List<ProblemCountVO> getProblemListCount(@Param("pidList") List<Long> pidList);


    IPage<JudgeVO> getCommonJudgeList(Page<JudgeVO> page, @Param("searchPid") String searchPid, @Param("status") Integer status, @Param("username") String username, @Param("uid") String uid, @Param("completeProblemID") Boolean completeProblemID, @Param("gid") Long gid);

    int getTodayJudgeNum();

    ProblemCountVO getProblemCount(@Param("pid") Long pid, @Param("gid") Long gid);

    List<Judge> getLastYearUserJudgeList(@Param("uid") String uid, @Param("username") String username);

    ProblemCountVO getContestProblemCount(@Param("pid") Long pid, @Param("cpid") Long cpid, @Param("cid") Long cid, @Param("startTime") Date startTime, @Param("sealRankTime") Date sealRankTime, @Param("adminList") List<String> adminList);

    IPage<JudgeVO> getContestJudgeList(Page<JudgeVO> page, @Param("displayId") String displayId, @Param("cid") Long cid, @Param("status") Integer status, @Param("username") String username, @Param("uid") String uid, @Param("beforeContestSubmit") Boolean beforeContestSubmit, @Param("rule") String rule, @Param("startTime") Date startTime, @Param("sealRankTime") Date sealRankTime, @Param("sealTimeUid") String sealTimeUid, @Param("completeProblemID") Boolean completeProblemID);

    List<ContestScrollBoardSubmissionVO> getContestScrollBoardSubmission(@Param("cid") Long cid, @Param("uidList") List<String> uidList);
}
